<template>
	<view class="container">

		<view class="item_div" v-for="(item,index) in data_list" :key="item.id">
			<view>{{item.title}}</view>
			<radio-group style="margin: 16rpx 0 20rpx 0;display: flex;" @change="onRadioChange($event,index)">
				<label style="display: flex;align-items: center;">
					<radio style="transform:scale(0.8);" :checked="item.value == 1" value="1" disabled></radio>
					是
				</label>
				<label style="display: flex;align-items: center;margin: 0 0 0 100rpx;">
					<radio style="transform:scale(0.8)" :checked="item.value == 0" value="0" disabled></radio>
					否
				</label>
			</radio-group>
			<view style="width: 100%;height: 1rpx;background-color: #eeeeee;"></view>
		</view>

		<view style="margin: 48rpx 0 0 24rpx;display: flex;align-items: baseline;"> 客户签名 </view>

		<image :src="sign_url" style="border: solid 1rpx #cccccc;margin: 24rpx 24rpx 0 24rpx;border-radius: 12rpx;width: calc(100% - 50rpx);height: 280rpx;"></image>

	</view>
	</view>
</template>

<script>
	const uploadImage = require('@/util/oss/upload.js')
	export default {
		data() {
			return {
				install_id: '', // 传过来的安装单id
				data_list: [], // 页面数据列表
				sign_url: '', // 签名图片的url
			}
		},

		onLoad(opts) {
			this.install_id = opts.install_id
			// console.log('this.install_id = ', this.install_id);
		},

		mounted() {
			this.getEvaluate()
		},

		methods: {

			// 单选框改变事件
			onRadioChange(event, index) {

			},

			// 接口:回访数据
			async getEvaluate() {
				let that = this
				uni.showLoading({ title: '加载中', mask: true, })
				let res = await that.$getEvaluate({ id: this.install_id })
				// console.log('$getEvaluate.res = ', res);
				if (res.code == 1) {
					this.data_list = res.data.info
					this.sign_url = res.data.signature
				} else {
					uni.showToast({ icon: 'none', title: res.msg ? res.msg : '获取数据失败' })
				}
			},

		}
	}
</script>

<style scoped>
	.container {
		display: flex;
		flex-direction: column;
		font-size: 30rpx;
		font-weight: bold;
	}

	.item_div {
		display: flex;
		flex-direction: column;
		margin: 36rpx 24rpx 0 24rpx;
	}
</style>